<?php
/**
 * BOM component of the product
 */
$id = Xview::instance()->val("materialid");
$block = new Fox\Html\Block("bComponents");
$tree = new \Fox\Grid\Tree("tComponents");
$tree->fieldcat(array("componentid",array("bomlabel","label"),array("bomqty","quantity"),array("parentid","materialid"),"position"));
$tree->setFieldAttr("*","SetHiddenInput",true);
$tree->setFieldAttr(array("level","materialid","position"),"SetHidden",true);
$tree->SetInput(true,true,false,false,true);
$tree->footer()->add(new Fox\Html\Button("add",
				"FoxDisplay('addContact','?mod=material&act=components&sac=add&id=$id',null,'InputSerialize(\'bComponents\')')"
				));
				
$block->add($tree);
return $block;